//
//  HotsCell.m
//  QuicklyPlay
//
//  Created by 你的温柔是我唯一沉溺 on 15/10/30.
//  Copyright © 2015年 OPteam. All rights reserved.
//

#import "HotsCell.h"
#import "DataManager.h"
#import "HotsViewController.h"
#import "HomeViewController.h"

@interface HotsCell ()
@property (weak, nonatomic) IBOutlet UILabel *boredLB;

@property (weak, nonatomic) IBOutlet UIButton *digBtn;
@property (weak, nonatomic) IBOutlet UILabel *digs;

@property (weak, nonatomic) IBOutlet UIImageView *digsView;

@property (weak, nonatomic) IBOutlet UIImageView *shareView;

@property(nonatomic,strong)UILabel *label;

@end


@implementation HotsCell



-(void)cellSetMessageWithModel:(VideosModel *)model
{   
    
    self.boredLB.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    self.boredLB.layer.borderWidth = 0.5;
    
    self.digBtn.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    self.digBtn.layer.borderWidth = 0.5;
    
    
    self.shareBtn.layer.borderWidth = 0.5;
    self.shareBtn.layer.borderColor = [[UIColor grayColor] CGColor];
    
    self.playsLabel.text =[NSString stringWithFormat:@"播放: %@", model.plays];
    NSTimeInterval time = [model.publish_time doubleValue];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:time];
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"MM月dd日 HH:mm"];
    self.publish_timeLabel.text = [formatter stringFromDate:date];

    [self.img_url sd_setImageWithURL:[NSURL URLWithString:model.img_url]];
    self.titleLabel.text = model.title;
}

- (IBAction)digButtonAction:(id)sender {

    DataManager *manager = [DataManager sharedInstance];
    NSString *message = [manager saveDataWithDicti:self.getModel];
    
    if ([message isEqualToString:@"收藏过了哦"]) {
    }
    
    
    //登陆状态 收藏
    UIAlertView*alertV = [[UIAlertView alloc]initWithTitle:@"提示" message:message delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消",nil] ;
    [alertV show] ;
  
}






//提示信息:
//-(void)setcapion
//{
//    //创建一个label，用于提示的信息
//    _label = [[UILabel alloc] initWithFrame:CGRectMake(160, 150, 75, 30)];
//    _label.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
//    _label.text = @"点赞成功";
//    _label.layer.cornerRadius = 10;
//    _label.layer.borderWidth = 1;
//    _label.layer.borderColor = [UIColor redColor].CGColor;
//    _label.layer.masksToBounds = YES;
//    _label.textColor = [UIColor redColor];
//    _label.font = [UIFont systemFontOfSize:15];
//    _label.textAlignment = NSTextAlignmentCenter;
//    [self addSubview:_label];
//    
//    //创建定时器，用于label在0.3秒之后自动消失:
//    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(doTimer) userInfo:nil repeats:NO];
//    
//}
//实现时候将label移除
-(void)doTimer
{
    //实现在1秒之后清除label:
    [_label removeFromSuperview];
}


- (void)awakeFromNib {

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];


}

@end
